import { mapState, mapActions } from 'vuex'
export default {
  name: 'Home',
  data() {
    return {
      pages: [
        { text: '收藏', name: 'iconfont icon-shoucang', color: 'red' },
        { text: '历史', name: 'iconfont icon-lishi', color: 'green' },
        { text: '作品', name: 'iconfont icon-zuopin', color: 'skyblue' }
      ],
      features: [
        { title: '设置', path: 'settings' },
        { title: '原地', path: 'mine' },
        { title: '消息', path: 'message' }
      ],
      namecard: [
      ]
    }
  },
  computed: {
    ...mapState('mine', [
      'userinfo'
    ]),
    infolist() {
      return [
        { text: '动态', number: this.userinfo.art_count },
        { text: '粉丝', number: this.userinfo.fans_count },
        { text: '关注', number: this.userinfo.follow_count }
      ]
    }
  },
  methods: {
    ...mapActions('mine', [
      'getinfo'
    ]),
    userinfobtn() {
      this.$router.push({
        path: 'settings'
      })
    },
    loginout() {
      sessionStorage.removeItem('token')
      this.$router.push({
        path: '/'
      })
    }
  },
  mounted() {
    this.getinfo()
  }
}
